/******************************************************************************
 *
 * ngcap - network sniffer using raw sockets
 *
 * Author:        cr
 * E-mail:        cr.at.netgarage.org
 * WWW:           http://www.netgarage.org
 * Copyright (C): 2009 by cr
 *
 * This file is part of ngcap.
 *
 * ngcap is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * ngcap is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with ngcap.  If not, see <http://www.gnu.org/licenses/>.
 *
 *****************************************************************************/

#ifndef _PACKET_HPP_
#define _PACKET_HPP_
//#include "packet_header.hpp"
//#include <iostream>
//#include <string>
#include <sstream>
//#include <iomanip>
//#include "trace.hpp"
#include <vector>
#include "frame.hpp"

class Packet;

class capturedPacket
{
public:
    capturedPacket();
    std::vector<Frame*> packet;
    void print();
    void clear();
    bool getDrop() const;
    void setDrop(bool d);
private:
    std::vector<Frame*>::iterator it;
    std::vector<Frame*>::iterator end;
    static int packetcount;
    bool drop;
};

class Packet
{
public:
    Packet(unsigned char* p, unsigned int s);
    unsigned char* getData() const;
    unsigned int getSize() const; 
protected:
    unsigned char* data;
    unsigned int size;
};

#endif
